var GameSetupXmlReader = function(gameSetupXmlFile){	
	var thisObj = this;
		$.ajax({
			type: "GET",
			url: gameSetupXmlFile,
			dataType: "xml",
			async: false,
			success: function(xml) {
//			var rules = $.textToXML(rhtmlspecialchars(data.orders).substring(1));
			thisObj.setUpObj = $.xmlToJSON(xml);
			}
		});
	
	this.timesRegress  = parseInt(this.setUpObj.rules[0].progress[0].times);
	this.percentageRegress  = parseInt(this.setUpObj.rules[0].regress[0].correctpercentage);

	this.timesProgress = parseInt(this.setUpObj.rules[0].regress[0].times);
	this.percentageProgress  = parseInt(this.setUpObj.rules[0].progress[0].correctpercentage);
	
	this.getLevels = function(){
	var levels = this.setUpObj.levels[0].level
		this.length = function()
		{
		return levels.length;
		}
	return levels;
	}
	
	this.getPatternSize = function(level){
	return parseInt(this.getLevels()[level].patternsize);
	}
	this.getNBack = function(level){
	return parseInt(this.getLevels()[level].nback);
	}
	this.getTurns = function(level){
	return parseInt(this.getLevels()[level].turns);
	}	
}